import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {HomepageComponent} from './homepage/homepage.component';
import {AccountDetailComponent} from './account-detail/account-detail.component';
import {AddCarComponent} from './add-car/add-car.component';
import {ApplyComponent} from './apply/apply.component';
import {BindCardComponent} from './bind-card/bind-card.component';
import {BindIdComponent} from './bind-id/bind-id.component';
import {CarInfoComponent} from './car-info/car-info.component';
import {DrawMoneyComponent} from './draw-money/draw-money.component';
import {EditCardComponent} from './edit-card/edit-card.component';
import {FriendsComponent} from './friends/friends.component';
import {MarketComponent} from './market/market.component';
import {OrderDetailComponent} from './order-detail/order-detail.component';
import {OrderListComponent} from './order-list/order-list.component';
import {ProtocolComponent} from './protocol/protocol.component';
import {RuleComponent} from './rule/rule.component';
import {ServiceComponent} from './service/service.component';
import {SetComponent} from './set/set.component';
import {ShareComponent} from './share/share.component';
import {UsercenterComponent} from './usercenter/usercenter.component';
import { Protocol } from '_debugger';

const routes : Routes = [
  // 首页
  {
    path: '',
    component: HomepageComponent,
    data: {
      footerShow: 1,
      title: '城市车友惠'
    }
  },
  // 账户明细
  {
    path: 'accountDetail',
    component: AccountDetailComponent,
    data: {
      title: '账户明细'
    }
  },
  // 填写车辆信息
  {
    path: 'addCar',
    component: AddCarComponent,
    data: {
      title: '添加车辆'
    }
  },
  // 申请代理
  {
    path: 'apply',
    component: ApplyComponent,
    data: {
      title: '申请代理'
    }
  },
  // 绑定银行卡
  {
    path: 'bindCard',
    component: BindCardComponent,
    data: {
      title: '绑定银行卡'
    }
  },
  // 上传驾驶执照
  {
    path: 'bindId/:id',
    component: BindIdComponent,
    data: {
      title: '车辆确认'
    }
  },
  // 车子的违章纪录
  {
    path: 'carInfo',
    component: CarInfoComponent,
    data: {
      title: '违章纪录'
    }
  },
  // 取现
  {
    path: 'drawMoney',
    component: DrawMoneyComponent,
    data: {
      title: '取现'
    }
  },
  // 更改银行卡
  {
    path: 'editCard',
    component: EditCardComponent,
    data: {
      title: '编辑银行卡'
    }
  },
  // 会员
  {
    path: 'friends',
    component: FriendsComponent,
    data: {
      title: '我的会员'
    }
  },
  // 推荐商城
  {
    path: 'market',
    component: MarketComponent,
    data: {
      title: '推荐商城',
      footerShow: 2
    }
  },
  // 订单详情
  {
    path: 'orderDetail/:id',
    component: OrderDetailComponent,
    data: {
      title: '订单详情'
    }
  },
  // 订单列表
  {
    path: 'orderList',
    component: OrderListComponent,
    data: {
      footerShow: 3,
      title: '订单列表'
    }
  },
  // 收益规则
  {
    path: 'rule',
    component: RuleComponent,
    data: {
      title: '收益规则'
    }
  },
  // 用户协议
  {
    path: 'protocol',
    component: ProtocolComponent,
    data: {
      title: '用户协议'
    }
  },
  // 客服留言
  {
    path: 'service',
    component: ServiceComponent,
    data: {
      title: '客服留言'
    }
  },
  // 设置
  {
    path: 'set',
    component: SetComponent,
    data: {
      title: '设置'
    }
  },
  // 分享
  {
    path: 'share/:id',
    component: ShareComponent,
    data: {
      title: '分享'
    }
  },
  // 分享(打开自己的分享页)
  {
    path: 'share',
    component: ShareComponent,
    data: {
      title: '分享'
    }
  },
  // 个人中心
  {
    path: 'usercenter',
    component: UsercenterComponent,
    data: {
      title: '个人中心',
      footerShow: 4
    }
  }
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule {}
